<template>
  <p class="px-4 py-2 border-b">
        <div class=" flex justify-between items-center">
        <h3 class="flex-1">用户评价({{count}})</h3>

         <wx-launch
            class="relative w-20 h-10 top-2"
            :path='miniPath'
            >
            <span class="absolute top-0 right-0"
                :class="isWx ? 'pointer-events-none' : ''"
                    @click="$openApp"
                >
                <button class="text-sm text-gray-600" 
                    >查看全部</button>
                <van-icon name="arrow" />
            </span>
      </wx-launch>

        
        </div>

        <ul class="pt-2 divide-y divide-gray-400">
            <li 
            class="pb-2"
            v-for="item in one" :key="item.id">
                <div class="flex">
                    <van-image
                        round
                        width="2rem"
                        height="2rem"
                        :src="item.user.avatar"
                        />
                    <div class="flex flex-col flex-1 px-2">
                        <span class="text-gray-600">{{item.user.name}}</span>
                        <span>
                            <van-rate
                            readonly
                            v-model='item.rank'
                            :size="16"
                            color="#ffd21e"
                            void-icon="star"
                            />
                        </span>
                    </div>
                    <span class="text-gray-600">{{$ymd(item.created_at)}}</span>
                </div>
                <p class="mt-2 text-gray-700">{{item.content}}</p>
            </li>
        </ul>
    </p>
</template>

<script>
// import weappBtn from '../components/weappBtn.vue'
import wxLaunch from '../../components/wxLaunch.vue'

export default {
  props: ['count', 'all'],
  inject: ['isWx'],
  components: { wxLaunch },
  computed: {
    one() {
      return this.all.splice(0, 1)
    },
  },
  methods: {},
}
</script>

<style>
</style>